package src;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by dell on 2017/7/27.
 */
public class MapTest {
    public static void main(String[] args) {
        Map map=new HashMap();
        Map map1=new HashMap();
        map1.put("1",1);
        map1.put("2",2);
        map.put("周一",724);
        map.put("周二",725);
        map.put("周三",726);
        map.put("周四",728);
        System.out.println(map.put("周三",777));
        System.out.println(map);
        System.out.println("是否含指定key？:"+map.containsKey("周三"));
        System.out.println("是否含指定value？："+map.containsValue(777));
        for (Object obj:map.keySet()){
            System.out.println(obj+"-->"+map.get(obj));
        }
        map.remove("周一");
        System.out.println(map);
        System.out.println(map.size());
        System.out.println(map.values());
        map.putAll(map1);
        System.out.println(map);
        System.out.println(map.entrySet());
//        map.clear();
//        System.out.println(map);
        map.replace("1",4);
        System.out.println(map);
    }
}
